<div id="addnew_hotel_room_type"></div>
<div id="hotel_room_types_table">
  <table>
    <tr>
      <td> 
        <%= link_to 'back', hotels_path, class: "btn btn btn-inverse", remote: true %>    
      </td>
      <td>
        <%= link_to 'Add New', new_hotel_room_type_path({ hid: params[:hid]}), class: "btn btn-primary", remote: true %>
      </td>
    </tr>
  </table>
  <table class="table">
    <thead>
      <tr>
        <th> room name </th>
        <th style="text-align:center;"> IDR </th>
        <th style="text-align:center;"> USD </th>
        <th style="text-align:center;"> IDR promo </th>
        <th style="text-align:center;"> USD promo </th>
        <th style="text-align:center;"> max_guest </th>
        <th style="text-align:center;"> is on promoted </th>
        <th style="text-align:center;"> facilities </th>
        <th style="text-align:center;"> Images </th>   
        <th style="text-align:center;">Options</th>
      </tr>
    </thead>
    <tbody id="hotel_room_types">
      <% @hotel_room_types.each do |hrt| %>
        <tr>
          <td><%= hrt.room_name %> <br/>
          <%= image_tag hrt.primary_picture.url(:thumb) %>
          </td>
          <td class="text-center"><%= number_to_currency(hrt.idr_price, :unit => "Rp. ", :delimiter => "," ,:precision => 0 ) %></td>
          <td class="text-center"><%= number_to_currency(hrt.usd_price, :unit => "$. ", :delimiter => "," ,:precision => 0 ) %></td>
          <td class="text-center"><%= number_to_currency(hrt.idr_promotion_price, :unit => "Rp. ", :delimiter => "," ,:precision => 0 ) %></td>
          <td class="text-center"><%= number_to_currency(hrt.usd_promotion_price, :unit => "$. ", :delimiter => "," ,:precision => 0 ) %></td>
          <td class="text-center"><%= hrt.max_guest %></td>
          <td class="text-center"><span class="<%= (hrt.is_on_promoted == false) ? raw('label label-important') : raw('label label-success') %>"><%= (hrt.is_on_promoted == true) ? raw('Promoted') : raw('Not Promoted') %></span></td>
          <td style="text-align:center;"> <%= link_to "facilities", {controller: "hotel_room_types", action: "room_facility_list", room_type_id: hrt.id, hid: params[:hid]}, remote: true %> </td>
          <td class="text-center"><%= link_to "images", hotel_room_type_images_path({hrt: hrt.id, hid: params[:hid]}), remote: true %></td>
          <td class="text-center"> 
            <%= link_to 'Edit', edit_hotel_room_type_path(hrt, { hid: params[:hid]}), remote: true %> | 
            <%= link_to 'Delete', {controller: 'hotel_room_types', action: 'destroy' , id: hrt.id , hid: params[:hid] }, method: :delete, remote: true, data: { confirm: 'Are you sure?' } %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
  <div class="collection_paginator">
    <%#= will_paginate hotel_room_types %>
  </div>
</div>